Embodiments of the present invention relate generally to methods and systems for logging of messages in a development environment and more particularly to providing dynamically adaptive logging of runtime messages generated by an application.
Logging refers to the generation of messages and the recording of activity based on those messages. A logging framework is commonly used in a development environment by developers of an application under test. In a logging framework, a logger application or object allows the application under development to log messages generated during execution of that application in the development environment. For example, the application can log a message by passing an object or an exception having a particular severity level to the logging framework. The logger of the framework can log a message associated with the object or exception which can then be used by the developers to trace execution of the application in an effort to debug the application. Current logging frameworks, such as the Java logging framework for example, are based on a static log level associated with the specific object or exception. For example, these levels can be defined in terms of severity such as “trace,” “debug,” “info,” “warning,” “error,” and “fatal” to indicate increasing degrees of how serious a message should be considered. These levels are associated with the code by the code developer at design time. The logger framework can be configured by the developer to log those messages generated at or above a particular severity level.
However, the static definition of a log level in such an approach can present some difficulties for the developers. For example, if the severity level is set too high, the developer may not be able to find enough information in the logs to effectively find a root cause of a problem or to otherwise troubleshoot a problem. To correct this, the developer needs to change the setup or configuration of the logging framework to capture the information needed, e.g., to change the severity level of messages logged. This may, in many cases, require the system to be restarted. Then, if the severity level is too low, the logs may be flooded with such a volume of messages that the developer can have a difficult, if not impossible, task of finding a relevant message in the resulting logs. Hence, there is a need for improved methods and systems for logging of messages in a development environment.